import threading
import time

g_num = 0

def sum1():
    for i in range(10000000):
        global g_num
        g_num += 1
    print("sum1:",g_num)

def sum2():
    for i in range(10000000):
        global g_num
        g_num += 1
    print("sum2:",g_num)

if __name__ == '__main__':
    sum1_thread = threading.Thread(target=sum1)
    sum2_thread = threading.Thread(target=sum2)
    sum1_thread.start()
    sum1_thread.join()
    sum2_thread.start()